package com.hfxt.constants;

import java.math.BigDecimal;

/***
 * 系统中保存的一些常量
 */
public class Constants {
    //通用常量
    public static class Common {
        //否
        public final static Integer NOT = 0;
        //是
        public final static Integer YES = 1;
        //女
        public final static Integer SEX_WOMEN = 0;
        //男
        public final static Integer SEX_MAN = 1;
        //数据精度
        public final static Integer DECIMAL_DIGITS = 2;
    }

    //访问来源
    public static class SourceType {
        //访问来源-APP
        public final static Integer APP = 0;
        //访问来源-PC
        public final static Integer PC = 1;
    }

    //连接符
    public static class Connnector {
        //逗号
        public final static String COMMA_ = ",";
        //下划线
        public final static String UNDERLINE = "_";
        //冒号
        public final static String COLON = ":";
    }

    //时长
    public static class Duration {
        //一秒
        public final static Integer SECOND_INT = 1;
        //一分钟
        public final static Integer MINUTE_INT = SECOND_INT * 60;
        //半小时
        public final static Integer HALF_HOUR_INT = MINUTE_INT * 30;
    }

    //正则的一些常量
    public static class RegConstant {
        //手机号正则
        public static String PHONE_REGSTR = "^[1][0-9]{10}$";
        //密码正则
        public static String PASSWORD_REGSTR = "^([A-Z]|[a-z]|[0-9]|[_]){6,10}$";
    }

    //SMS相关常量
    public static class Sms {
        public static class TemplateCode {
            public static String LOGIN_OR_REGISTER = "SMS_212350082";
        }

        public static class CodeType {
            public static Integer LOGIN_OR_REGISTER = 0;
            public static Integer PASS_UPDATE = 1;
            public static Integer ORDER_NOTICE = 2;
        }
    }

    //Redis中Key相关的常量
    public static class RedisKey {
        public static String PROJECT_PRIFIX = "demo";
        public static String LOGIN_OR_REGISTER = "login_or_register";
        public static String SMS_PRIFIX = "sms";
        public static String TOKEN_PRIFIX = "token";

        /**
         * 项目公共 前缀
         */
        public final static String PREFIX = "demo";
        /**
         * 首页类型树
         */
        public final static String KEY_HOME_TREE = PREFIX + "_home_classifyTree:";
    }

    /**
     * 首页相关常量
     */
    public static class Home {
        public final static Integer MODEL_SIZE = 5;
    }

    /**
     * 订单
     */
    public static class Order {

        /**
         * 预约状态
         */
        public static class AppointStatus {

            /**
             * 预约
             */
            public final static Integer APPOINT = 1;

            /**
             * 完成
             */
            public final static Integer FINISH = 2;
        }

        /**
         * 预约时间段
         */
        public static class TemporalInterval {

            /**
             * 上午
             */
            public final static Integer AM = 1;

            /**
             * 中午
             */
            public final static Integer NOON = 2;

            /**
             * 下午
             */
            public final static Integer PM = 3;

            /**
             * 晚上
             */
            public final static Integer NIGHT = 4;
        }


        /**
         * 支付渠道
         */
        public static class Channel {

            /**
             * 现金
             */
            public final static Integer CASH = 1;

            /**
             * 刷卡
             */
            public final static Integer CARD = 2;

            /**
             * 支付宝
             */
            public final static Integer ALIPAY = 3;

            /**
             * 微信
             */
            public final static Integer WECHAT = 4;
        }


        /**
         * 订金相关
         */
        public static class Subscription {

            /**
             * 最低订金金额
             */
            public final static Integer MINIMUM = 30;

            /**
             * 最低订金金额
             */
            public final static BigDecimal MINIMUM_DECIMAL = new BigDecimal(MINIMUM);

            /**
             * 订金占估算价格的比例：10%
             */
            public final static Double RATIO = 0.1D;

        }


        /**
         * 维修订单状态（1:预约下单,2:支付定金,9:用户取消,10:完成）
         */
        public static class MaintainStatus {

            /**
             * 预约下单
             */
            public final static Integer APPOINT = 1;

            /**
             * 支付定金
             */
            public final static Integer PAY_DEPOSIT = 2;

            /**
             * 用户取消
             */
            public final static Integer CANCLE = 9;

            /**
             * 完成
             */
            public final static Integer FINISH = 10;
        }

        public static class PayStaus {


            /**
             * 未支付
             */
            public final static Integer UN_PAY = 1;

            /**
             * 支付成功
             */
            public final static Integer SUCCESS = 2;

            /**
             * 支付失败
             */
            public final static Integer FAIL = 3;

        }

    }
}
